﻿using Windows.UI.Xaml.Controls;
using Windows.UI.ApplicationSettings;

namespace RssReader.Common
{
    public class SettingsCommandHelper
    {
        public void On_commands_requested(SettingsPane sender, SettingsPaneCommandsRequestedEventArgs args)
        {
            var cmd = new SettingsCommand("RSSReader", "Manage Categories", x =>
            {
                var settingsPanel = new Settings();
                settingsPanel.Show();
            });

            var privacyCmd = new SettingsCommand("PrivacyPolicy", "Privacy Policy", x =>
            {
                var privacyPolicyFlyout = new PrivacyPolicy {Width = 400};
                privacyPolicyFlyout.Show();
            });

            args.Request.ApplicationCommands.Clear();
            args.Request.ApplicationCommands.Add(cmd);
            args.Request.ApplicationCommands.Add(privacyCmd);
        }
    }
}
